#include "stdio.h"

int giveGem(int *gem, int gemSize, int **operations, int operationsSize, int *operationsColSize) {
    int min = 1000, max = 0;
    int from, to, give;
    for (int i = 0; i < operationsSize; i++) {
        from = operations[i][0];
        to = operations[i][1];
        give = gem[from] / 2;
        gem[from] = gem[from] - give;
        gem[to] = gem[to] + give;
    }

    for (int i = 0; i < gemSize; i++) {
        if (gem[i] > max) {
            max = gem[i];
        }
        if (gem[i] < min) {
            min = gem[i];
        }
    }
    return max - min;
}

int main() {
    printf("111\n");
    return 0;
}

